﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SocialPlatformSDK.Model;
using SocialPlatformSDK.Services;
using SocialPlatformSDK.Services.Util;
using SocialPlatformSDK.Util;

namespace SocialPlatformSDK
{
    public class RenRenSocFactory : SocialFactoryBase<RenRenSocFactory>
    {
        private IOAuthConfigruation _renrenOAuthConfig;
        private RenRenAPIService<RenRenServiceArgument> _renrenAPIService;
        public  void Init()
        {
            _renrenOAuthConfig = RenRenOAuthInfo.Instance;
            _renrenOAuthConfig.Init();
            _renrenAPIService = new RenRenAPIService<RenRenServiceArgument>(_renrenOAuthConfig.AccessToken, _renrenOAuthConfig);

        }
        public override void Validate()
        {

            _renrenOAuthConfig.Validate();
        }

        public override void ClearAccessToken()
        {
            _renrenOAuthConfig.ClearAccessToken();
        }

        public override void SaveData(AccessToken token)
        {
            _renrenOAuthConfig.TokenIso.SaveData(token);
        }

        public override void SocialSharePublish(string channelName, string channelUrl, string message, SocialShareHandler callBack)
        {
            throw new NotImplementedException();
        }

        public RenRenAPIService<RenRenServiceArgument> GetAPIService()
        {
            _renrenAPIService = new RenRenAPIService<RenRenServiceArgument>(_renrenOAuthConfig.AccessToken, _renrenOAuthConfig);
            return _renrenAPIService;
        }
    }
}
